Controlling method for electronic device, and electronic device

ABSTRACT

A controlling method for an electronic device includes: determining an orientation of a laser projector; projecting a laser in a first mode by the laser projector when the laser projector is oriented toward a first side where the display screen is located; and projecting a laser in a second mode by the laser projector when the laser projector is oriented toward a second side opposite to the display screen, and the laser projected in the second mode has a greater energy than that of the laser projected in the first mode.

CROSS-REFERENCE TO RELATED APPLICATION(S)

This application is a continuation application of InternationalApplication No. PCT/CN2020/085819, filed Apr. 21, 2020, which claimspriority to and benefits of Chinese Patent Application No.201910472716.4, filed on May 31, 2019, the entire contents of both ofwhich are incorporated herein by reference.

TECHNICAL FIELD

The present disclosure relates to the technical field of consumerelectronics, and more particularly to a controlling method for anelectronic device and an electronic device.

BACKGROUND

In an existing mobile phone with a laser projector, the laser projectoris generally disposed in a front housing of the mobile phone, and thelaser projector is only used in a front usage state to shoot a closerobject in distance. For example, the laser projector is only used in thefront usage state to acquire a depth image. Therefore, the laserprojector can only be used in fewer scenes.

SUMMARY

Embodiments of the present disclosure provide a controlling method foran electronic device and an electronic device.

Embodiments of the present disclosure provide a controlling method foran electronic device. The electronic device includes a housing, adisplay screen and a rotatable assembly, the display screen is disposedat a side of the housing, the rotatable assembly includes a substrateand a laser projector disposed in the substrate, the substrate isrotatably installed to the housing such that the laser projector isselectively oriented toward a first side where the display screen islocated or toward a second side opposite to the display screen; and thecontrolling method includes: determining an orientation of the laserprojector; projecting a laser in a first mode by the laser projectorwhen the laser projector is oriented toward the first side where thedisplay screen is located; and projecting a laser in a second mode bythe laser projector when the laser projector is oriented toward thesecond side opposite to the display screen, and the laser projected inthe second mode has a greater energy than that of the laser projected inthe first mode.

Embodiments of the present disclosure provide an electronic device,which includes a housing, a display screen, a rotatable assembly and aprocessor, the display screen is disposed at a side of the housing, therotatable assembly includes a substrate and a laser projector disposedin the substrate, the substrate is rotatably installed to the housingsuch that the laser projector is selectively oriented toward a firstside where the display screen is located or toward a second sideopposite to the display screen; the processor is configured to determinean orientation of the laser projector; the laser projector is configuredto: project a laser in a first mode when the laser projector is orientedtoward the first side where the display screen is located, and project alaser in a second mode when the laser projector is oriented toward thesecond side opposite to the display screen, and the laser projected inthe second mode has a greater energy than that of the laser projected inthe first mode.

Additional aspects and advantages of embodiments of present disclosurewill be given in part in the following descriptions, become apparent inpart from the following descriptions, or be learned from the practice ofthe embodiments of the present disclosure.

BRIEF DESCRIPTION OF DRAWINGS

These and/or other aspects and advantages of embodiments of the presentdisclosure will become apparent and more readily appreciated from thefollowing descriptions made with reference to the drawings, in which:

FIG. 1 is a schematic diagram of an electronic device according to someembodiments of the present disclosure.

FIG. 2 is a schematic diagram of an electronic device according to someembodiments of the present disclosure.

FIG. 3 is a schematic diagram of an electronic device according to someembodiments of the present disclosure.

FIG. 4 is a schematic flowchart of a controlling method for anelectronic device according to some embodiments of the presentdisclosure.

FIG. 5 is a schematic perspective diagram of an electronic deviceaccording to some embodiments of the present disclosure.

FIG. 6 is a schematic diagram of a laser source of a laser projector inan electronic device according to some embodiments of the presentdisclosure.

FIG. 7 is a schematic flowchart of a controlling method for anelectronic device according to some embodiments of the presentdisclosure.

FIG. 8 is a schematic perspective diagram of an electronic deviceaccording to some embodiments of the present disclosure.

FIG. 9 is a schematic perspective diagram of an electronic deviceaccording to some embodiments of the present disclosure.

FIG. 10 is a schematic diagram illustrating a system architecture of anelectronic device according to some embodiments of the presentapplication.

FIG. 11 is a schematic flowchart of a controlling method for anelectronic device according to some embodiments of the presentdisclosure.

FIG. 12 is a schematic diagram illustrating a principle of a controllingmethod for an electronic device according to some embodiments of thepresent disclosure.

FIG. 13 is a schematic flowchart of a controlling method for anelectronic device according to some embodiments of the presentdisclosure.

FIG. 14 is a schematic flowchart of a controlling method for anelectronic device according to some embodiments of the presentdisclosure.

FIG. 15 is a schematic flowchart of a controlling method for anelectronic device according to some embodiments of the presentdisclosure.

FIG. 16 is a schematic flowchart of a controlling method for anelectronic device according to some embodiments of the presentdisclosure.

FIG. 17 is a schematic diagram illustrating a principle of a controllingmethod for an electronic device according to some embodiments of thepresent disclosure.

FIG. 18 is a schematic flowchart of a controlling method for anelectronic device according to some embodiments of the presentdisclosure.

DETAILED DESCRIPTION

Embodiments of the present disclosure will be described in detail below,examples of which are shown in the accompanying drawings, in which thesame or similar elements and elements having same or similar functionsare denoted by like reference numerals throughout the descriptions. Theembodiments described herein with reference to the accompanying drawingsare explanatory and illustrative, which are only used to generallyunderstand the present disclosure, but shall not be construed to limitthe present disclosure.

As illustrated in FIG. 1 to FIG. 4, a controlling method for anelectronic device 100 according to the present disclosure is applicableto the electronic device 100. The electronic device 100 includes ahousing 11, a display screen 12 and a rotatable assembly 13, the displayscreen 12 is disposed at a side of the housing 11, the rotatableassembly 13 includes a substrate 131 and a laser projector 14 disposedin the substrate 131, and the substrate 131 is rotatably installed tothe housing 11 such that the laser projector 14 is selectively orientedtoward a first side where the display screen 12 is located or toward asecond side opposite to the display screen 12. As illustrated in FIG. 4,the controlling method includes:

041, determining an orientation of the laser projector 14;

042, projecting a laser in a first mode by the laser projector 14 whenthe laser projector 14 is oriented toward the first side where thedisplay screen 12 is located (as illustrated in FIG. 3); and

043, projecting a laser in a second mode by the laser projector 14 whenthe laser projector 14 is oriented toward the second side opposite tothe display screen 12 (as illustrated in FIG. 2).

As illustrated in FIG. 2, in some embodiments, the electronic device 100further includes a Hall sensor assembly 16, the Hall sensor assembly 16includes a first sensor 161 and a second sensor 162, the first sensor161 is disposed in the substrate 131, and the second sensor 162 isdisposed in the housing 11 and corresponds to the first sensor 161; andthe determining (041) the orientation of the laser projector 14includes: determining the orientation of the laser projector 14 throughthe Hall sensor assembly 16.

As illustrated in FIG. 2 and FIG. 7, in some embodiments, thedetermining the orientation of the laser projector 14 through the Hallsensor assembly 16 includes:

0711, acquiring a Hall value of the Hall sensor assembly 16;

0712, determining that the laser projector 14 is oriented toward thefirst side where the display screen 12 is located when the Hall value isless than a first preset value; and

0713, determining that the laser projector 14 is oriented toward thesecond side opposite to the display screen 12 when the Hall value isgreater than a second preset value.

As illustrated in FIG. 5, in some embodiments, the electronic device 100further includes a state selection key 17, and the determining (041) theorientation of the laser projector 14 includes: determining theorientation of the laser projector 14 through the state selection key17.

As illustrated in FIG. 1 to FIG. 3, in some embodiments, a power of thelaser projector 14 for projecting the laser in the first mode is smallerthan that of the laser projector 14 for projecting the laser in secondmode; and/or the laser projector 14 includes a plurality of point lightsources 141 each controlled independently, and the number of the pointlight sources 141 turned on by the laser projector 14 in the first modeis less than that of the point light sources 141 turned on by the laserprojector 14 in the second mode.

In some embodiments, the electronic device 100 further includes an imagecollector 15 disposed at a surface of the substrate 131 where the laserprojector 14 is located, when the laser projector 14 projects a laser,the laser projector 14 projects the laser at a first operating frequencyto a scene. The controlling method further includes:

0114: acquiring collection images by the image collector 15 at a secondoperating frequency, the second operating frequency being greater thanthe first operating frequency;

0115: distinguishing, among the collection images, a first imagecollected when the laser projector 14 does not project the laser from asecond image collected when the laser projector 14 projects the laser;and

0116: calculating a depth image according to the first image, the secondimage and a reference image.

As illustrated in FIG. 1 to FIG. 4, the electronic device 100 accordingto embodiments of the present disclosure includes a housing 11, adisplay screen 12, a rotatable assembly 13 and a processor 20. Thedisplay screen 12 is disposed at a side of the housing 11. The rotatableassembly 13 includes a substrate 131 and a laser projector 14 disposedin the substrate 131. The substrate 131 is rotatably installed to thehousing 11 such that the laser projector 14 is selectively orientedtoward a first side where the display screen 12 is located or toward asecond side opposite to the display screen 12. The processor 20 isconfigured to determine an orientation of the laser projector 14. Thelaser projector 14 is configured to: project a laser in a first modewhen the laser projector 14 is oriented toward the first side where thedisplay screen 12 is located, and project a laser in a second mode whenthe laser projector 14 is oriented toward the second side opposite tothe display screen 12. The laser projected in the second mode has agreater energy than that of the laser projected in the first mode.

As illustrated in FIG. 2, in some embodiments, the electronic device 100further includes a Hall sensor assembly 16, the Hall sensor assembly 16includes a first sensor 161 and a second sensor 162, the first sensor161 is disposed in the substrate 131, and the second sensor 162 isdisposed in the housing 11 and corresponds to the first sensor 161; andthe processor 20 is further configured to determine the orientation ofthe laser projector 14 through the Hall sensor assembly 16.

As illustrated in FIG. 2 and FIG. 7, in some embodiments, the processor20 is further configured to:

0711, acquire a Hall value of the Hall sensor assembly 16;

0712, determine that the laser projector 14 is oriented toward the firstside where the display screen 12 is located when the Hall value is lessthan a first preset value; and

0713, determine that the laser projector 14 is oriented toward thesecond side opposite to the display screen 12 when the Hall value isgreater than a second preset value.

As illustrated in FIG. 5, in some embodiments, the electronic device 100further includes a state selection key 17, and the processor 20 isfurther configured to determine the orientation of the laser projector14 through the state selection key 17.

As illustrated in FIG. 1 to FIG. 3, in some embodiments, power of thelaser projector 14 for projecting the laser in the first mode is smallerthan that of the laser projector 14 for projecting the laser in secondmode; and/or the laser projector 14 includes a plurality of point lightsources 141 each controlled independently; and the number of the pointlight sources 141 turned on by the laser projector 14 in the first modeis less than that of the point light sources 141 turned on by the laserprojector 14 in the second mode.

As illustrated in FIG. 3, in some embodiments, the electronic device 100further includes an image collector 15 disposed at a surface of thesubstrate 131 where the laser projector 14 is located, when the laserprojector 14 projects a laser, the laser projector 14 is configured toproject the laser at a first operating frequency to a scene; the imagecollector 15 is configured to acquire collection images at a secondoperating frequency, and the second operating frequency is greater thanthe first operating frequency; and the processor 20 is configured to:distinguish, among the collection images, a first image collected whenthe laser projector 14 does not project the laser from a second imagecollected when the laser projector 14 projects the laser; and tocalculate a depth image according to the first image, the second imageand a reference image.

As illustrated in FIG. 1 to FIG. 3, in some embodiments, the housing 11has an end surface 113 and a rear surface 112 opposite to the displayscreen 12, the rear surface 112 is defined with a receiving groove 114penetrating the end surface 113, and the rotatable assembly 13 isrotatably installed in the receiving groove 114; when the laserprojector 14 is oriented toward the first side where the display screen12 is located, the substrate 131 protrudes from the end surface 113;when the laser projector 14 is oriented toward the second side oppositeto the display screen 12, a surface of the substrate 131 is flush withthe end surface 113.

As illustrated in FIG. 1 to FIG. 3, in some embodiments, the housing 11has a front surface 111, a rear surface 112 and an end surface 113, thefront surface 111 and the rear surface 112 are located at two oppositesides of the housing 11, respectively, the end surface 113 is connectedwith the front surface 111 and the rear surface 112, the display screen12 is disposed on the front surface 111 and defined with a notch 121 atan end thereof close to the end surface 113, the housing 11 is definedwith an accommodating groove 115 which penetrates the front surface 111,the rear surface 112 and the end surface 113 and is communicated withthe notch 121, and the rotatable assembly 13 is rotatably installed inthe accommodating groove 115.

As illustrated in FIG. 1 to FIG. 3, in some embodiments, the housing 11has a front surface 111, a rear surface 112 and an end surface 113, thedisplay screen 12 is installed on the front surface 111 of the housing11 and covers 85% or more of an area of the front surface 111.

As illustrated in FIG. 6 and FIG. 10, in some embodiments, the laserprojector 14 includes a laser source 140, the laser source 140 includesa plurality of point light sources 141; and the plurality of the pointlight sources 141 form a plurality of light emitting arrays 142 arrangedin an annular shape.

As illustrated in FIG. 6 and FIG. 10, in some embodiments, the lightemitting arrays 142 are turned on in such a manner that the farther alight emitting array 142 is away from a center of the laser source 140,the earlier the light emitting array 142 is turned on.

As illustrated in FIG. 6 and FIG. 10, in some embodiments, the laserprojector 14 includes a laser source 140 and a first driver 147, and thefirst driver 147 is configured to drive the laser source 140 to projecta laser to an object to be measured.

As illustrated in FIG. 8, in some embodiments, the housing 11 has afront surface 111, a rear surface 112 and an end surface 113, thedisplay screen 12 is disposed on the front surface 111 of the housing 11and defined with a notch 121 at an end thereof close to the end surface113.

As illustrated in FIG. 5 and FIG. 8, in some embodiments, the electronicdevice 100 further includes a floodlight 50 disposed in the substrate131, and the floodlight 50 and the laser projector 14 are located at thesame surface of the substrate 131.

As illustrated in FIG. 1 to FIG. 3, in the controlling method for anelectronic device 100 according to the present disclosure, theelectronic device 100 includes a housing 11, a display screen 12 and arotatable assembly 13, the display screen 12 is disposed at a side ofthe housing 11, the rotatable assembly 13 includes a substrate 131 and alaser projector 14 disposed in the substrate 131, and the substrate 131is rotatably installed to the housing 11 such that the laser projector14 is selectively oriented toward a first side where the display screen12 is located or toward a second side opposite to the display screen 12;as illustrated in FIG. 4, the controlling method includes:

041, determining an orientation of the laser projector 14;

042, projecting a laser in a first mode by the laser projector 14 whenthe laser projector 14 is oriented toward the first side where thedisplay screen 12 is located (as illustrated in FIG. 3); and

043, projecting a laser in a second mode by the laser projector 14 whenthe laser projector 14 is oriented toward the second side opposite tothe display screen 12 (as illustrated in FIG. 2).

The electronic device 100 according to the present disclosure may beused to implement the aforementioned controlling method. Specifically,the electronic device 100 further includes a processor 20, the step 041may be implemented by the processor 20, and the steps 042 and 043 may beimplemented by the laser projector 14. In other words, the processor 20may be configured to determine the orientation of the laser projector14, and the laser projector 14 may be configured to project a laser in afirst mode when the laser projector 14 is oriented toward the first sidewhere the display screen 12 is located, and project a laser in a secondmode by the laser projector 14 when the laser projector 14 is orientedtoward the second side opposite to the display screen 12.

The electronic device 100 may be a mobile phone, a tablet computer, alaptop computer, a smart wearable device (such as a smart watch, a smartbracelet, a smart helmet, smart glasses, etc.), a virtual realitydevice, and the like. The present disclosure will be illustrated bytaking a mobile phone as an example of the electronic device 100, butthe form of the electronic device 100 is not limited to a mobile phone.

As illustrated in FIG. 1 and FIG. 5, the housing 11 includes a frontsurface 111, a rear surface 112 and an end surface 113, the frontsurface 111 and the rear surface 112 are located at two opposite sidesof the housing 11, respectively, and the end surface 113 is connectedwith the front surface 111 and the rear surface 112. In embodiments ofthe present disclosure, the rear surface 112 is defined with a receivinggroove 114 penetrating the end surface 113.

The display screen 12 is installed on the front surface 111 of thehousing 11 and covers 85% or more of an area of the front surface 111,such as 85%, 86%, 87%, 88%, 89%, 90%, 91%, 92%, 93%, 95% or even 100% ofthe area of the front surface 111. The display screen 12 may beconfigured to display a screenage, and the screenage may includeinformation like text, images, videos, icons and the like.

The rotatable assembly 13 is rotatably installed in the receiving groove114. Specifically, the rotatable assembly 13 includes the substrate 131and the laser projector 14, the substrate 131 includes two rotatingshafts 132 (as illustrated in FIG. 2) installed to two oppositesidewalls of the receiving groove 114, respectively, and an axial linepassing through the rotating shafts 132 is parallel to each of the frontsurface 111, the rear surface 112 and the end surface 113. The laserprojector 14 is installed in the substrate 131 and exposed from asurface of the substrate 131. The rotation of the substrate 131 drivesthe laser projector 14 to rotate, so that the laser projector 14 isselectively oriented toward the first side where the display screen 12is located or toward the second side opposite to the display screen 12,when the laser projector 14 is oriented toward the first side where thedisplay screen 12 is located, the substrate 131 protrudes from the endsurface 113; when the laser projector 14 is oriented toward the secondside opposite to the display screen 12, a surface of the substrate 131is flush with the end surface 113, and the substrate 131 does notprotrude from the end surface 113.

The electronic device 100 further includes an image collector 15, theimage collector 15 is disposed in the substrate 131 and located at asurface of the substrate 131 where the laser projector 14 is located,that is, the laser projector 14 and the image collector 15 are exposedfrom the same surface of the substrate 131. The laser projector 14 iscooperated with the image collector 15 to acquire depth information ofan object to be measured for three-dimensional modeling,three-dimensional image generation, distance measurement and the like.The laser projector 14 and the image collector 15 may be installed on abracket, and then the bracket, the laser projector 14 and the imagecollector 15 are installed in the substrate 131 together. Alternatively,the substrate 131 is a bracket, and the laser projector 14 and the imagecollector 15 are both installed in the substrate 131.

Generally, when the user of the electronic device 100 uses theelectronic device 100, the display screen 12 is oriented toward theuser. When the laser projector 14 is oriented toward the first sidewhere the display screen 12 is located (as illustrated in FIG. 3), thelaser projector 14 is in a front usage state, and both the displayscreen 12 and the laser projector 14 face the user of the electronicdevice 100, in this case, the laser projector 14 may be used as a frontlaser projector, the user is able to view the content displayed on thedisplay screen 12 and use the laser projector 14 to project a lasertowards a side where the user is located, such that the user is able touse the laser projector 14 (and the image collector 15) to perform facerecognition, iris recognition, and the like. When the laser projector 14is oriented toward the second side opposite to the display screen 12,the laser projector 14 is in a rear usage state (as illustrated in FIG.2), the display screen 12 faces the user of the electronic device 100,and the laser projector 14 faces away from the user of the electronicdevice 100, in this case, the laser projector 14 may be used as a rearlaser projector, the user is able to view the content displayed on thedisplay screen 12 and use the laser projector 14 to project a lasertowards a side away from the user, for example, the user is able to usethe laser projector 14 (and the image collector 15) to acquire a depthimage of an object to be measured at a side of the electronic device 100facing away from the user.

In embodiments of the present disclosure, the laser projector 14 may beused in the first mode or the second mode to project a laser, the firstmode corresponds to a case that the laser projector 14 is in the frontusage state, the second mode corresponds to a case that the laserprojector 14 is in the rear usage state, and the energy of the laserprojected in the second mode is greater than that of the laser projectedin the first mode. Specifically, a power of the laser projector 14 forprojecting the laser in the first mode may be less than that of thelaser projector 14 for projecting the laser in the second mode, so thatthe energy of the laser projected in the second mode is greater thanthat of the laser projected in the first mode, and in this case, amaximum distance (i.e., a projection distance) reachable by the laserprojected by the laser projector 14 in the second mode is greater than amaximum distance (i.e., a projection distance) reachable by the laserprojected by the laser projector 14 in the first mode. At the same time,a rear distance range detectable by the image collector 15 incooperation with the laser projector 14 in the rear usage state isgreater than a front distance range detectable by the image collector 15in cooperation with the laser projector 14 in the front usage state. Forexample, the front distance range detectable by the image collector 15in cooperation with the laser projector 14 is within 25 cm, while therear distance range detectable by the image collector 15 in cooperationwith the laser projector 14 is greater than 25 cm (an accuracy withinthe distance range of 25 cm is very poor). Alternatively, the frontdistance range slightly overlaps the rear distance range, for example,the front distance range detectable by the image collector 15 incooperation with the laser projector 14 is within 25 cm, while the reardistance range detectable by the image collector 15 in cooperation withthe laser projector 14 is greater than 20 cm.

In the electronic device 100 and the controlling method for theelectronic device 100 according to the present disclosure, the rotatableassembly 13 is rotatably installed to the housing 11, such that thelaser projector 14 is selectively oriented toward the first side wherethe display screen 12 is located or toward the second side opposite tothe display screen 12, and the maximum distance reachable by the laserprojected by the laser projector 14 when the laser projector 14 isoriented toward the second side opposite to the display screen 12 isgreater than that reachable by the laser projected by the laserprojector 14 when the laser projector 14 is oriented toward the firstside where the display screen 12 is located. In this way, the laserprojector 14 can be used as both the front laser projector and the rearlaser projector, which increases the usage scenes of the electronicdevice 100; at the same time, there is no need to provide two laserprojectors 14 to be used as the front laser projector and the rear laserprojector, respectively, thereby saving the cost of the electronicdevice 100.

As illustrated in FIG. 6, in some embodiments, the laser projector 14includes a laser source 140, the laser source 140 includes a pluralityof point light sources 141 each controlled independently. Specifically,each point light source 141 can be turned on and off independently. Thenumber of the point light sources 141 turned on by the laser projector14 in the first mode is less than that of the point light sources 141turned on by the laser projector 14 in the second mode, in this case,the power of each point light source 141 for projecting the laser may bethe same, so that the energy of the laser projected in the second modeis greater than that of the laser projected in the first mode, and themaximum distance reachable by the laser projected by the laser projector14 in the second mode is greater than that reachable by the laserprojected by the laser projector 14 in the first mode.

As illustrated in FIG. 6, in some embodiments, the plurality of thepoint light sources 141 form a plurality of light emitting arrays 142,and the plurality of the light emitting arrays 142 are each controlledindependently. Specifically, multiple point light sources 141 in eachlight emitting array 142 can be turned on or off at the same time, andthe power of the multiple point light sources 141 in each light emittingarray 142 may be the same. In other embodiments, the multiple pointlight sources 141 in each light emitting array 142 may also becontrolled independently.

In some embodiments, the plurality of the light emitting arrays 142 arearranged in an annular shape. Lasers emitted by the point light sources141 in the light emitting array 142 arranged in the annular shape cancover a wider field of view, so that more depth information of theobject to be measured can be obtained. Among others, the annular shapemay be a square annular shape or a circular annular shape.

As illustrated in FIG. 6, in some embodiments, as the projectiondistance increases, the light emitting arrays 142 are turned on in sucha manner that the farther a light emitting array 142 is away from acenter of the laser source 140, the earlier the light emitting array 142is turned on. For example, as illustrated in FIG. 6, there are six lightemitting arrays 142 in total, including five annular sub-arrays 144 andone square sub-array 143. In a direction from a periphery of the lasersource 140 to the center of the laser source 140, the five annularsub-arrays 144 are arranged in sequence, which are marked as A, B, C, D,and E. In some embodiments, when the laser projector 14 is orientedtoward the first side where the display screen 12 is located, the pointlight sources 141 in the annular sub-arrays 144 marked as A and B areturned on; when the laser projector 14 is oriented toward the secondside opposite to the display screen 12, the point light sources 141 inthe annular sub-arrays 144 marked as A, B and C may be turned on, or thepoint light sources 141 in the annular sub-arrays 144 marked as A, B, Cand D may be turned on, or the point light sources 141 in the annularsub-arrays 144 marked as A, B, C, D and E may be turned on, or the pointlight sources 141 in the annular sub-arrays 144 marked as A, B, C, D andE and the point light sources 141 in the square sub-array 143 may beturned on.

In some embodiments, the number of the point light sources 141 turned onwhen the laser projector 14 is in the first mode is less than that ofthe point light sources 141 turned on when the laser projector 14 is inthe second mode, so that the energy of the laser projected by the laserprojector 14 when the laser projector 14 is oriented toward the firstside where the display screen 12 is located is less than that of thelaser projected by the laser projector 14 when the laser projector 14 isoriented toward the second side opposite to the display screen 12.

It can be understood that a diffractive optical element (not shown infigures) of the laser projector 14 has a limited diffraction ability,that is, a part of the lasers emitted by the laser source 140 is notdiffracted by the diffractive optical element but is directly emitted.The laser emitted directly has a larger energy, which is very likely toharm the user's eyes. Therefore, when the laser projector 14 is orientedtoward the first side where the display screen 12 is located, the laserprojector 14 projects the laser in the first mode, that is, when theprojection distance is shorter, the laser projector 14 first turns onthe annular sub-array 144 away from the center of the laser source 140,which avoids the laser projected by the laser source 140 to enter theuser's eyes directly without undergoing the diffraction attenuationeffect of the diffractive optical element, thereby improving thesecurity of the laser projector 14; and when the laser projector 14 isoriented toward the second side opposite to the display screen 12, thelaser projector 14 projects the laser in the second mode, that is, whenthe projection distance is longer, the laser projector 14 simultaneouslyturns on the annular sub-array 144 away from the center of the lasersource 140 and the annular sub-array 144 near the center of the lasersource 140, so as to increase the maximum distance reachable by thelasers projected by the laser projector 14.

As illustrated in FIG. 2 and FIG. 7, in some embodiments, the electronicdevice 100 further includes a Hall sensor assembly 16, the Hall sensorassembly 16 includes a first sensor 161 and a second sensor 162, thefirst sensor 161 is disposed in the substrate 131, and the second sensor162 is disposed in the housing 11 and corresponds to the first sensor161; and the determining the orientation of the laser projector 14 maybe achieved through the Hall sensor assembly 16. Specifically, thecontrolling method includes:

0711, acquiring a Hall value of the Hall sensor assembly 16;

0712, determining that the laser projector 14 is oriented toward thefirst side where the display screen 12 is located when the Hall value isless than a first preset value;

0713, determining that the laser projector 14 is oriented toward thesecond side opposite to the display screen 12 when the Hall value isgreater than a second preset value;

072, projecting a laser in a first mode by the laser projector 14 whenthe laser projector 14 is oriented toward the first side where thedisplay screen 12 is located; and

073, projecting a laser in a second mode by the laser projector 14 whenthe laser projector 14 is oriented toward the second side opposite tothe display screen 12.

The above controlling method may also be implemented by the electronicdevice 100, in which the steps 0711, 0712 and 0713 may be sub-steps ofthe step 041 described hereinbefore, the step 072 is basically the sameas the step 042 described hereinbefore, and the step 073 is basicallythe same as the step 043 described hereinbefore. Specifically, theprocessor 20 is electrically connected to the Hall sensor assembly 16,the processor 20 may be further configured to determine the orientationof the laser projector 14 through the Hall sensor assembly 16, and theprocessor 20 may be further configured to implement the steps 0711, 0712and 0713. That is, the processor 20 may be further configured to acquirethe Hall value of the Hall sensor assembly 16, determine that the laserprojector 14 is oriented toward the first side where the display screen12 is located when the Hall value is less than the first preset value,and determine that the laser projector 14 is oriented toward the secondside opposite to the display screen 12 when the Hall value is greaterthan the second preset value.

In some embodiments of the present disclosure, the first sensor 161 maybe a magnet 161, and the second sensor 162 may be a Hall sensor 162. TheHall sensor 162 may be a gauss meter or a digital Hall sensor, and theHall value is a gauss value. When the laser projector 14 is orientedtoward the second side opposite to the display screen 12 (i.e., therotatable assembly 13 is in an initial state), an S pole of the magnet161 is located at an end of the magnet 161 close to the Hall sensor 162,and an N pole of the magnet 161 is located at an end of the magnet 161away from the Hall sensor 162. When the laser projector 14 is orientedtoward the first side where the display screen 12 is located, the N poleof the magnet 161 is located at the end of the magnet 161 close to theHall sensor 162, and the S pole of the magnet 161 is located at the endof the magnet 161 away from the Hall sensor 162. When the S pole of themagnet 161 is closer to the Hall sensor 162, the magnetic field wherethe Hall sensor 162 is located is stronger, and the Hall value collectedby the Hall sensor 162 is larger and is positive; when the N pole of themagnet 161 is closer to the Hall sensor 162, the Hall value collected bythe Hall sensor 162 is smaller and is negative.

When the Hall value collected by the Hall sensor 162 is less than thefirst preset value, for example, when the Hall value of the Hall sensor162 acquired by the processor 20 is −90, which is less than the firstpreset value of −85, it is determined that the laser projector 14 isoriented toward the first side where the display screen 12 is located;when the Hall value collected by the Hall sensor 162 is greater than thesecond preset value, for example, when the Hall value of the Hall sensor162 acquired by the processor 20 is 40, which is greater than the secondpreset value of 35, it is determined that the laser projector 14 isoriented toward the second side opposite to the display screen 12. Itwill be appreciated that, the first preset value and the second presetvalue are related to factors like characteristics of the magnet 161 anda distance between the magnet 161 and the Hall sensor 162; thecharacteristics of the magnet 161 include the material, shape and sizeof the magnet 161; and the shorter the distance between the magnet 161and the Hall sensor 162, the greater the Hall value collected by theHall sensor 162.

The electronic device 100 and the controlling method according toembodiments of the present disclosure determine the orientation of thelaser projector 14 through the Hall sensor assembly 16, so that thelaser projector 14 may be used to project a laser in a correspondingmode without the user manually selecting the orientation of the laserprojector 14, which improves the usage experience of the electronicdevice 100.

As illustrated in FIG. 5, in some embodiments, the electronic device 100further includes a state selection key 17 electrically connected to theprocessor 20, and the determination of the orientation of the laserprojector 14 may be achieved through the state selection key 17.Specifically, the processor 20 may be further configured to determinethe orientation of the laser projector 14 through the state selectionkey 17. The state selection key 17 may be a physical key and includes afirst state key 171 and a second state key 172. When the processor 20detects that the first state key 171 is triggered, the processor 20determines that the laser projector 14 is oriented toward the first sidewhere the display screen 12 is located; when the processor 20 detectsthat the second state key 172 is triggered, the processor 20 determinesthat the laser projector 14 is oriented toward the second side oppositeto the display screen 12. In other embodiments, the state selection key17 may be a virtual key and may be displayed by the display screen 12.For example, the state selection key 17 may be an orientation switchingkey displayed by the display screen 12.

The electronic device 100 and the controlling method according toembodiments of the present disclosure determine the orientation of thelaser projector 14 through the state selection key 17, so that the usercan accurately select the orientation of the laser projector 14 asrequired.

As illustrated in FIG. 2, in some embodiments, the electronic device 100further includes a visible light camera 40, the visible light camera 40includes a primary camera 41 and a secondary camera 42, both the primarycamera 41 and the secondary camera 42 are installed in the substrate131, and the primary camera 41 and the secondary camera 42 are locatedat a surface of the substrate 131 where the laser projector 14 islocated. The primary camera 41 may be a wide-angle camera with lowsensitivity to motion, a relatively slow shutter speed can also ensurethe sharpness of image shooting, and the wide-angle camera has a largefield of view, covers a wide range of scenes, emphasizes the foregroundand highlights near and far comparison. The secondary camera 42 may be atelephoto camera, and a telephoto lens of the telephoto camera is ableto identify objects at a further distance. Alternatively, the primarycamera 41 is a color camera, and the secondary camera 42 is a black andwhite camera. The electronic device 100 described herein may include aplurality of the cameras, such as two, three, four or more cameras. Insome embodiments, the laser projector 14, the secondary camera 42, theprimary camera 41 and the image collector 15 are sequentially arrangedat intervals along a same straight line.

As illustrated in FIG. 8 and FIG. 9, in some embodiments, the displayscreen 12 is disposed on the front surface 111 and defined with a notch121 at an end thereof close to the end surface 113, the housing 11 isdefined with an accommodating groove 115 which penetrates the frontsurface 111, the rear surface 112 and the end surface 113, theaccommodating groove 115 corresponds to the notch 121 and iscommunicated with the notch 121, and the rotatable assembly 13 isrotatably installed in the accommodating groove 115.

In embodiments of the present disclosure, the size of the substrate 131is slightly smaller than that of the accommodating groove 115 to enablethe substrate 131 to rotate in the accommodating groove 115. When thelaser projector 14 is oriented toward the second side opposite to thedisplay screen 12, two opposite surfaces (i.e., a front surface and arear surface) of the substrate 131 are flush with the rear surface 112and an outermost light-exiting surface of the display screen 12,respectively; when the laser projector 14 is oriented toward the firstside where the display screen 12 is located, the two opposite surfaces(i.e., the front surface and the rear surface) of the substrate 131 areflush with the rear surface 112 and the outermost light-exiting surfaceof the display screen 12, respectively.

As illustrated in FIG. 10, in some embodiments, the laser projector 14includes a laser source 140 and a first driver 147, and the first driver147 may be configured to drive the laser source 140 to project a laserto an object to be measured. Both the laser projector 14 and the imagecollector 15 are connected to the processor 20. The processor 20 mayprovide an enable signal for the laser projector 14, specifically, theprocessor 20 may provide an enable signal for the first driver 147. Theimage collector 15 is connected to the processor 20 via an I2C bus. Thelaser projector 14 is able to emit a laser, such as an infrared laser,which is reflected by an object in a scene after reaching the object,the reflected laser may be received by the image collector 15, and theprocessor 20 may calculate depth information of the object according tothe laser emitted by the laser projector 14 and laser received by theimage collector 15. In an example, the depth information may be obtainedby the laser projector 14 and the image collector 15 via time of flight(TOF). In another example, the depth information may be obtained by thelaser projector 14 and the image collector 15 based on a structuredlight ranging principle. The specification of the present disclosure isillustrated by taking the case where the depth information is obtainedby the laser projector 14 and the image collector 15 based on thestructured light ranging principle as an example. In this case, thelaser projector 14 is an infrared laser transmitter, and the imagecollector 15 is an infrared camera.

When the image collector 15 and the laser projector 14 are cooperated touse, in an example, the image collector 15 may control projection timingof the laser projector 14 through a first strobe signal, which isgenerated according to timing of the image collector 15 for acquiringcollection images and may be regarded as electrical signals withalternate high and low levels, and the laser projector 14 projects thelaser according to the laser projection timing instructed by the firststrobe signal. Specifically, the processor 20 may send an imagecollection instruction through an I2C bus to activate the laserprojector 14 and the image collector 15 and make the laser projector 14and the image collector 15 work. After receiving the image collectioninstruction, the image collector 15 controls a switching element 30through the first strobe signal, if the first strobe signal is at thehigh level, the switching element 30 sends a first pulse signal (pwn1)to the first driver 147, and the first driver 147 drives the lasersource 140 to project a laser into a scene according to the first pulsesignal; if the first strobe signal is at the low level, the switchingelement 30 stops sending the first pulse signal to the first driver 147,and the laser source 140 does not project the laser. Alternatively, itis also possible that when the first strobe signal is at the low level,the switching element 30 sends the first pulse signal to the firstdriver 147, and the first driver 147 drives the laser source 140 toproject a laser into a scene according to the first pulse signal; whenthe first strobe signal is at the high level, the switching element 30stops sending the first pulse signal to the first driver 147, and thelaser source 140 does not project the laser. In another example, it isalso possible that the first strobe signal is not needed when the imagecollector 15 and the laser projector 14 are cooperated to use. In thiscase, the processor 20 sends the image collection instruction to theimage collector 15 and sends a laser projection instruction to the firstdriver 147 at the same time, the image collector 15 starts to acquirethe collection image after receiving the image collection instruction,and the first driver 147 drives the laser source 140 to project a laserafter receiving the laser projection instruction. When the laserprojector 14 projects a laser, the laser forms a laser pattern withspeckles, which is projected onto an object to be measured in a scene.The image collector 15 collects the laser pattern reflected by theobject to be measured to obtain a speckle image, and sends the speckleimage to the processor 20 through a mobile industry processor interface(MIPI). Each time the image collector 15 sends a frame of speckle imageto the processor 20, the processor 20 receives a data stream. Theprocessor 20 may calculate a depth image according to the speckle imageand a reference image pre-stored in the processor 20.

In some embodiments, the visible light camera 40 may also be connectedto the processor 20 via an I2C bus, that is, both the primary camera 41and the secondary camera 42 are connected to the processor 20 via theI2C bus. The visible light camera 40 may be configured to collect avisible light image; that is to say, the primary camera 41 and thesecondary camera 42 are each configured to collect the visible lightimage, or the primary camera 41 and the secondary camera 42 arecooperated and used together to collect the visible light image; inother words, any one or both of the primary camera 41 and the secondarycamera 42 may be used to collect the visible light image. Each time thevisible light camera 40 (the primary camera 41 and/or the secondarycamera 42) sends a frame of visible light image to the processor 20, theprocessor 20 receives a data stream. The visible light camera 40 may beused alone, that is, when the user just wants to obtain the visiblelight image, the processor 20 sends an image collection instruction tothe visible light camera 40 (any one or both of the primary camera 41and the secondary camera 42) via the I2C bus to activate the visiblelight camera 40 and make the visible light camera 40 work. The visiblelight camera 40 collects a visible light image of a scene afterreceiving the image collection instruction, and sends the visible lightimage to the processor 20 through a mobile industry processor interface.The visible light camera 40 (any one of the primary camera 41 and thesecondary camera 42, or the primary camera 41 and the secondary camera42 together) may also be cooperated with the laser projector 14 and theimage collector 15, for example when the user wants to acquire athree-dimensional image based on a visible light image and a depthimage, if the image collector 15 has a same operating frequency as thatof the visible light camera 40, hardware synchronization between theimage collector 15 and the visible light camera 40 may be realizedthrough a sync signal. Specifically, the processor 20 sends the imagecollection instruction to the image collector 15 via the I2C bus. Afterreceiving the image collection instruction, the image collector 15 maycontrol the switching element 30 to send the first pulse signal (pwn1)to the first driver 147 through the first strobe signal, so that thefirst driver 147 drives the laser source 140 to emit a laser accordingto the first pulse signal; at the same time, the image collector 15 issynchronized with the visible light camera 40 through the sync signal,which controls the visible light camera 40 to collect the visible lightimage.

As illustrated in FIG. 2 and FIG. 10, the electronic device 100 mayfurther include a floodlight 50 disposed in the substrate 131, and thefloodlight 50 and the laser projector 14 are located at the same surfaceof the substrate 131. The floodlight 50 may be configured to emituniform area light to a scene, the floodlight 50 includes a floodlightsource 51 and a second driver 52, and the second driver 52 may beconfigured to drive the floodlight source 51 to emit the uniform arealight. The light emitted by the floodlight 50 may be infrared light orother invisible light, such as ultraviolet light. As an example, thepresent disclosure will be illustrated with reference to the case wherethe light emitted by the floodlight 50 is the infrared light, but theform of the light emitted by the floodlight 50 is not limited thereto.The floodlight 50 is connected to the processor 20, and the processor 20may provide an enable signal to drive the floodlight 50. Specifically,the processor 20 may provide the enable signal for the second driver 52.The floodlight 50 may be cooperated with the image collector 15 tocollect an infrared image. When the image collector 15 is cooperatedwith the floodlight 50 to use, in an example, the image collector 15 maycontrol emission timing of the floodlight 50 for emitting the infraredlight through a second strobe signal (independent from the first strobesignal through which the image collector 15 controls the laser projector14), the second strobe signal is generated according to timing of theimage collector 15 for acquiring the collection image and may beregarded as electrical signals with alternate high and low levels, andthe floodlight 50 emits the infrared light according to the infraredemission timing instructed by the second strobe signal. Specifically,the processor 20 may send an image collection instruction to the imagecollector 15 via the I2C bus, and the image collector 15 controls theswitching element 30 through the second strobe signal after receivingthe image collection instruction, if the second strobe signal is at thehigh level, the switching element 30 sends a second pulse signal (pwn2)to the second driver 52, and the second driver 52 controls thefloodlight source 51 to emit the infrared light according to the secondpulse signal; if the second strobe signal is at the low level, theswitching element 30 stops sending the second pulse signal to the seconddriver 52, and the floodlight source 51 does not emit the infraredlight. Alternatively, it is also possible that when the second strobesignal is at the low level, the switching element 30 sends the secondpulse signal to the second driver 52, and the second driver 52 controlsthe floodlight source 51 to emit the infrared light according to thesecond pulse signal; when the second strobe signal is at the high level,the switching element 30 stops sending the second pulse signal to thesecond driver 52, and the floodlight source 51 does not emit theinfrared light. When the floodlight 50 emits the infrared light, theimage collector 15 receives infrared light reflected by an object in ascene to form an infrared image, and sends the infrared image to theprocessor 20 through the mobile industry processor interface. Each timethe image collector 15 sends a frame of infrared image to the processor20, the processor 20 receives a data stream. This infrared image isusually used for iris recognition, face recognition, etc.

As illustrated in FIG. 1, FIG. 2 and FIG. 11, in some embodiments, theelectronic device 100 further includes an image collector 15, and theimage collector 15 and the laser projector 14 are installed on the samesurface of the substrate 131, when the laser projector 14 projects alaser (when the laser projector 14 projects a laser in the first mode,or when the laser projector 14 projects a laser in the second mode), thelaser projector 14 projects the laser to a scene at a first operatingfrequency, and the controlling method further includes:

0114, acquiring collection images by the image collector 15 at a secondoperating frequency, the second operating frequency being greater thanthe first operating frequency;

0115, distinguishing, among the collection images, a first imagecollected when the laser projector 14 does not project the laser from asecond image collected when the laser projector 14 projects the laser;and

0116, calculating a depth image according to the first image, the secondimage and a reference image.

In other words, the controlling methods include:

0111, determining an orientation of the laser projector 14;

0112, projecting a laser in a first mode by the laser projector 14 whenthe laser projector 14 is oriented toward the first side where thedisplay screen 12 is located;

0113, projecting a laser in a second mode by the laser projector 14 whenthe laser projector 14 is oriented toward the second side opposite tothe display screen 12, the energy of the laser projected in the secondmode is greater than that of the laser projected in the first mode;

0114, acquiring collection images by the image collector 15 at a secondoperating frequency when the laser projector 14 projects a laser to ascene at a first operating frequency, the second operating frequencybeing greater than the first operating frequency;

0115, distinguishing, among the collection images, a first imagecollected when the laser projector 14 does not project the laser from asecond image collected when the laser projector 14 projects the laser;and

0116, calculating a depth image according to the first image, the secondimage and a reference image.

The above controlling method may also be implemented by the electronicdevice 100, in which the step 0111 is basically the same as the step 041described hereinbefore, the step 0112 is basically the same as the step042 described hereinbefore, and the step 0113 is basically the same asthe step 043 described hereinbefore. The image collector 15 may beconfigured to implement the step 0114, and the processor 20 may befurther configured to implement the steps 0115 and 0116. In other words,the image collector 15 is configured to acquire the collection images atthe second operating frequency, and the processor 20 is furtherconfigured to distinguish, among the collection images, the first imagecollected when the laser projector 14 does not project the laser fromthe second image collected when the laser projector 14 projects thelaser, and to calculate the depth image according to the first image,the second image and the reference image.

Specifically, when the operating frequency of the image collector 15 isdifferent from that of the laser projector 14 (that is, the secondoperating frequency is greater than the first operating frequency), thedepth image needs to be acquired in usage scenes such as unlocking,payment, decryption, and 3D modeling. In an example, the processor 20simultaneously sends an image collection instruction for acquiring adepth image to the image collector 15 and the first driver 147 via theI2C bus. The first driver 147 drives the laser source 140 to emit theinfrared laser to a scene at the first operating frequency afterreceiving the image collection instruction; and the image collector 15collects infrared laser reflected back by an object in the scene at thesecond operating frequency to acquire the collection image afterreceiving the image collection instruction. For example, as illustratedin FIG. 12, a solid line represents laser emission timing of the laserprojector 14, a dashed line represents timing of the image collector 15for acquiring the collection images and the number of frames of thecollection images, and a dot dash line represents the number of framesof the third images obtained according to the first image and the secondimage, and the three kinds of lines, i.e., the solid line, the dashedline and the dot dash line are shown in this order from top to bottom inFIG. 12, and the second operating frequency is twice the first operatingfrequency. Referring to the solid line and the dashed line asillustrated in FIG. 12, the image collector 15 first receives infraredlight in the environment (hereinafter referred to as ambient infraredlight) to obtain the N^(th) frame of collection image (in this case, itis the first image, also known as a background image) when the laserprojector 14 does not project a laser, and sends the N^(th) frame ofcollection image to the processor 20 through the mobile industryprocessor interface; then, the image collector 15 receives the ambientinfrared light and an infrared laser emitted by the laser projector 14to acquire the (N+1)^(th) frame of collection image (in this case, it isthe second image, also known as an interference speckle image) when thelaser projector 14 projects a laser, and sends the (N+1)^(th) frame ofcollection image to the processor 20 through the mobile industryprocessor interface; subsequently, the image collector 15 receives theambient infrared light again to obtain the (N+2)^(th) frame ofcollection image (in this case, it is the first image) when the laserprojector 14 does not project a laser, and sends the (N+2)^(th) frame ofcollection image to the processor 20 through the mobile industryprocessor interface, and so on, that is, the image collector 15alternately obtains the first image and the second image.

In another example, the processor 20 sends a collection instruction foracquiring a depth image to the image collector 15 via an I2C bus. Theimage collector 15 controls the switching element through the firststrobe signal to send the first pulse signal to the first driver 147after receiving the image collection instruction, the first driver 147drives the laser source 140 to project a laser at the first operatingfrequency according to the first pulse signal (that is, the laserprojector 14 projects the laser at the first operating frequency), andthe image collector 15 collects the infrared laser reflected by anobject in a scene at the second operating frequency to obtain thecollection image. As illustrated in FIG. 12, the solid line representsthe laser emission timing of the laser projector 14, the dashed linerepresents the timing of the image collector 15 for acquiring thecollection images and the number of frames of the collection images, andthe dot dash line represents the number of frames of the third imagesobtained according to the first image and the second image, and thethree kinds of lines, i.e., the solid line, the dashed line and the dotdash line are shown in this order from top to bottom in FIG. 12, and thesecond operating frequency is twice the first operating frequency.Referring to the solid line and the dashed line as illustrated in FIG.12, the image collector 15 first receives the ambient infrared light toobtain the N^(th) frame of collection image (in this case, it is thefirst image, also known as a background image) when the laser projector14 does not project a laser, and sends the N^(th) frame of collectionimage to the processor 20 through the mobile industry processorinterface; then, the image collector 15 receives the ambient infraredlight and an infrared laser emitted by the laser projector 14 to acquirethe (N+1)^(th) frame of collection image (in this case, it is the secondimage, also known as an interference speckle image) when the laserprojector 14 projects the laser, and sends the (N+1)^(th) frame ofcollection image to the processor 20 through the mobile industryprocessor interface; subsequently, the image collector 15 receives theambient infrared light again to obtain the (N+2)^(th) frame ofcollection image (in this case, it is the first image) when the laserprojector 14 does not project a laser, and sends the (N+2)^(th) frame ofcollection image to the processor 20 through the mobile industryprocessor interface, and so on, that is, the image collector 15alternately obtains the first image and the second image.

It should be noted that the image collector 15 may simultaneouslyperform the acquisition of the collection image while sending thecollection image to the processor 20. Moreover, it is also possible thatthe image collector 15 acquires the second image first, and thenacquires the first image, and alternately perform the acquisition of thecollection image in this order. In addition, the above-describedmultiple relationship between the second operating frequency and thefirst operating frequency is only used as an example, and in otherembodiments, the multiple relationship between the second operatingfrequency and the first operating frequency may also be three times,four times, five times, six times and so on.

Each time the processor 20 receives a frame of collection image, theprocessor 20 will distinguish the received collection image anddetermine whether the collection image is the first image or the secondimage. After receiving at least one frame of first image and at leastone frame of second image, the processor 20 may calculate the depthimage according to the first image, the second image and the referenceimage. Specifically, since the first image is collected when the laserprojector 14 does not project a laser, light that forms the first imageincludes only the ambient infrared light, and since the second image iscollected when the laser projector 14 projects a laser, light that formsthe second image includes both the ambient infrared light and theinfrared laser emitted by the laser projector 14. Therefore, theprocessor 20 can remove the collection image formed by the ambientinfrared light from the second image according to the first image, so asto obtain the collection image only formed by the infrared laser (i.e.,the speckle image formed by the infrared laser).

It will be understood that the ambient light includes infrared lightwith the same wavelength as the infrared laser emitted by the laserprojector 14 (for example, including ambient infrared light with awavelength of 940 nm), and this part of infrared light will also bereceived by the image collector 15 when the image collector 15 acquiresthe collection image. When the brightness of the scene is high, theproportion of the ambient infrared light in the light received by theimage collector 15 will increase, resulting in inconspicuous laserspeckles in the collection image, thereby affecting the calculation ofthe depth image.

The controlling method according to the present disclosure controls thelaser projector 14 and the image collector 15 to work at differentoperating frequencies, so that the image collector 15 is able to collectboth the first image only formed by the ambient infrared light and thesecond image formed by both the ambient infrared light and the infraredlaser emitted by the laser projector 14, remove a part of the secondimage formed by the ambient infrared light according to the first image,so as to distinguish the laser speckles, and calculate the depth imageusing the collection image formed only by the infrared laser emitted bythe laser projector 14, without affecting the laser speckle matching,which avoids partial or complete loss of the depth information, therebyimproving the accuracy of the depth image.

As illustrated in FIG. 1, FIG. 2 and FIG. 13, in some embodiments, thecontrolling method includes:

0131, determining an orientation of the laser projector 14;

0132, projecting a laser in a first mode by the laser projector 14 whenthe laser projector 14 is oriented toward the first side where thedisplay screen 12 is located;

0133, projecting a laser in a second mode by the laser projector 14 whenthe laser projector 14 is oriented toward the second side opposite tothe display screen 12, the energy of the laser projected in the secondmode is greater than that of the laser projected in the first mode;

0134, acquiring collection images by the image collector 15 at a secondoperating frequency when the laser projector 14 projects a laser to ascene at a first operating frequency, the second operating frequencybeing greater than the first operating frequency;

01351, adding an image type for each frame of collection image;

01352, distinguishing the first image from the second image according tothe image type; and

0136, calculating a depth image according to the first image, the secondimage and a reference image.

As illustrated in FIG. 1, FIG. 2 and FIG. 14, in some embodiments, thecontrolling method includes:

0141, determining an orientation of the laser projector 14;

0142, projecting a laser in a first mode by the laser projector 14 whenthe laser projector 14 is oriented toward the first side where thedisplay screen 12 is located;

0143, projecting a laser in a second mode by the laser projector 14 whenthe laser projector 14 is oriented toward the second side opposite tothe display screen 12, the energy of the laser projected in the secondmode is greater than that of the laser projected in the first mode;

0144, acquiring collection images by the image collector 15 at a secondoperating frequency when the laser projector 14 projects a laser to ascene at a first operating frequency, the second operating frequencybeing greater than the first operating frequency;

014511, determining, according to collection time of each frame ofcollection image, an operating state of the laser projector 14 at thecollection time;

014512, adding an image type for each frame of collection imageaccording to the operating state;

01452, distinguishing the first image from the second image according tothe image type; and

0146, calculating a depth image according to the first image, the secondimage and a reference image.

The above controlling method may also be implemented by the electronicdevice 100, in which the step 0131 is basically the same as the step 041described hereinbefore, the step 0132 is basically the same as the step042 described hereinbefore, the step 0133 is basically the same as thestep 043 described hereinbefore, the step 0134 is basically the same asthe step 0114 described hereinbefore, the steps 01351 and 01352 may besub-steps of the step 0115 described hereinbefore, and the step 0136 isbasically the same as the step 0116 described hereinbefore; the step0141 is basically the same as the step 041 described hereinbefore, thestep 0142 is basically the same as the step 042 described hereinbefore,the step 0143 is basically the same as the step 043 describedhereinbefore, the step 0144 is basically the same as the step 0114described hereinbefore, the steps 014511 and 014512 may be sub-steps ofthe step 01351 described hereinbefore, the step 01452 is basically thesame as the step 01352 described hereinbefore, and the step 0146 isbasically the same as the step 0116 described hereinbefore. The steps01351, 01352, 014511, 014512 and 01452 all may be implemented by theprocessor 20. In other words, the processor 20 may also be configured toadd an image type for each frame of collection image, and distinguishthe first image from the second image according to the image type. Whenthe processor 20 is configured to add the image type for each frame ofcollection image, the processor 20 is specifically configured todetermine, according to the collection time of each frame of collectionimage, the operating state of the laser projector 14 at the collectiontime, and add the image type for each frame of collection imageaccording to the operating state.

Specifically, each time the processor 20 receives a frame of collectionimage from the image collector 15, the processor 20 will add the imagetype (stream_type) for the collection image, so that the first image andthe second image may be distinguished according to the image type insubsequent processing. Specifically, during the acquisition of thecollection image by the image collector 15, the processor 20 willmonitor the operating state of the laser projector 14 in real time viathe I2C bus. Each time the processor 20 receives a frame of collectionimage from the image collector 15, the processor 20 will acquire thecollection time of the collection image first, and then determineaccording to the collection time of the collection image whether thelaser projector 14 projects a laser or not during the collection time ofthe collection image, and add the image type for the collection imagebased on the judgment result. The collection time of the collectionimage may be start time or end time each time the image collector 15acquires the collection image, or any time between the start time andthe end time. In this way, it is possible to realize the correspondencebetween each frame of collection image and the operating state(projecting a laser or not) of the laser projector 14 during theacquisition of this frame of collection image, and accuratelydistinguish the type of the collection image. In an example, structuresof the image type (stream_type) are shown in Table 1:

TABLE 1 stream_type stream light 0 0 0 0 0 1

As illustrated in Table 1, when the stream is 0, it means that the datastream at this time is an image formed by the infrared light and/or theinfrared laser. When the light is 00, it means that the data stream atthis time is acquired without any equipment projecting the infraredlight and/or the infrared laser (there is only the ambient infraredlight), then the processor 20 may add a stream_type 000 for thecollection image to identify this collection image as the first image.When the light is 01, it means that the data stream at this time isacquired when the laser projector 14 projects the infrared laser (thereare both the ambient infrared light and the infrared laser), then theprocessor 20 may add a stream_type 001 for the collection image toidentify this collection image as the second image. The processor 20 maydistinguish the image types of the collection images according to thestream_type in the subsequent processing.

As illustrated in FIG. 1, FIG. 2 and FIG. 15, in some embodiments, thecontrolling method includes:

0151, determining an orientation of the laser projector 14;

0152, projecting a laser in a first mode by the laser projector 14 whenthe laser projector 14 is oriented toward the first side where thedisplay screen 12 is located;

0153, projecting a laser in a second mode by the laser projector 14 whenthe laser projector 14 is oriented toward the second side opposite tothe display screen 12, the energy of the laser projected in the secondmode is greater than that of the laser projected in the first mode;

0154, acquiring collection images by the image collector 15 at a secondoperating frequency when the laser projector 14 projects a laser to ascene at a first operating frequency, the second operating frequencybeing greater than the first operating frequency;

0155, distinguishing, among the collection images, a first imagecollected when the laser projector 14 does not project the laser from asecond image collected when the laser projector 14 projects the laser;

01561, calculating a third image according to the first image and thesecond image, a difference between collection time of the first imageand collection time of the second image being less than a preset value;and

01562, calculating a depth image according to the third image and areference image.

The above controlling method may also be implemented by the electronicdevice 100, in which the step 0151 is basically the same as the step 041described hereinbefore, the step 0152 is basically the same as the step042 described hereinbefore, the step 0153 is basically the same as thestep 043 described hereinbefore, the step 0154 is basically the same asthe step 0114 described hereinbefore, the step 0155 is basically thesame as the step 0115 described hereinbefore, and the steps 01561 and01562 may be sub-steps of the step 0116 described hereinbefore. Thesteps 01561 and 01562 may be implemented by the processor 20. That is,the processor 20 may be further configured to calculate the third imageaccording to the first image and the second image, and calculate thedepth image according to the third image and the reference image. Thedifference between the collection time of the first image and thecollection time of the second image is less than the preset value.

In the calculation of the depth image, the processor 20 may firstdistinguish the first images from the second images, and then select thesecond image of any frame and the first image of a specific framecorresponding to the second image of the any frame according to thecollection time, and the difference between the collection time of thefirst image of the specific frame and the collection time of the secondimage of the any frame is less than the preset value. Subsequently, theprocessor 20 calculates the third image according to the first image ofthe specific frame and the second image of the any frame, and the thirdimage is a collection image formed by only the infrared laser emitted bythe laser projector 14, which may also be referred to as an actualspeckle image. Specifically, there is a one-to-one correspondencebetween a plurality of pixels in the first image and a plurality ofpixels in the second image. Assuming that the first image is representedby P1, the second image is represented by P2, and the third image isrepresented by P3, the processor 20 may subtract a pixel value of apixel P1 _(i,j) in the first image from a pixel value of a pixel P2_(i,j) in the second image to obtain a pixel value of a pixel P3 _(i,j)in the third image, i.e., P3 _(i,j)=P2 _(i,j)−P1 _(i,j), i∈N+, j∈N+.Subsequently, the processor 20 may calculate the depth image accordingto the third image and the reference image. It should be noted that thenumber of frames of the second images, the number of frames of the thirdimages, and the number of frames of the depth images are equal. It willbe understood that since the difference between the collection time ofthe first image and the collection time of the second image is small,the intensity of the ambient infrared light in the first image is closerto that of the ambient infrared light in the second image, the accuracyof the third image calculated according to the first image and thesecond image is higher, which further reduces the influence of theambient infrared light on the acquisition of the depth image.

In some embodiments, the processor 20 may also add an image type for thethird image and the depth image, so as to distinguish data streamsobtained after processing the collection images. As illustrated in table2:

TABLE 2 stream_type stream light 0 1 1 1 X X

As illustrated in Table 2, when the stream is 0, it means that the datastream at this time is an image formed by the infrared light and/or theinfrared laser, when the stream is 1, it means that the data stream atthis time is the depth image. When the light is 11, it means backgroundsubtraction, i.e., removing a part of the collection image formed by theambient infrared light, then the processor 20 may add a stream_type 011for the data stream after the background subtraction to identify thisdata stream as the third image. When the light is XX, where X indicatesan unlimited value, the processor 20 may add a stream_type 1XX for thedata stream obtained after depth calculation to identify this datastream as the depth image.

In some embodiments, for the first image and the second image thatparticipate in the calculation of the depth image, the collection timeof the first image may be either before or after the collection time ofthe second image, which will not be limited herein.

In some embodiments, when the difference between the collection time ofthe first image and the collection time of the second image is less thanthe preset value, the first image and the second image may be images ofadjacent frames or images of non-adjacent frames. For example, when thesecond operating frequency is twice the first operating frequency, thefirst image and the second image whose collection time difference isless than the preset value are the images of adjacent frames; when thesecond operating frequency is more than twice the first operatingfrequency, for example, the second operating frequency is three timesthe first operating frequency, the first image and the second imagewhose collection time difference is less than the preset value may bethe images of adjacent frames or the images of non-adjacent frames (inthis case, there is still a frame of first image between the first imageand the second image).

In some embodiments, there may be several frames of first imagesparticipating in the calculation of the depth image. For example, whenthe second operating frequency is three times the first operatingfrequency, two adjacent frames of first images and one frame of secondimage adjacent to the two frames of first images may be selected tocalculate the third image. In this case, the processor 20 may firstperform fusion processing on the two frames of first images, forexample, add pixel values of corresponding pixels of the two frames offirst images and then take the average value to obtain a fusionprocessed first image, and then calculate the third image using thefusion processed first image and the one frame of second image adjacentto the two frames of first images.

In some embodiments, the processor 20 may calculate multiple frames ofthird image, such as the [(N+1)−N]^(th) frame of third image, the[(N+3)−(N+2)]^(th) frame of third image, the [(N+5)−(N+4)]^(th) frame ofthird image, etc., as illustrated in FIG. 12, and calculate multipleframes of depth images corresponding to the multiple frames of thirdimage. Of course, in other embodiments, it is also possible that theprocessor 20 only calculates one frame of third image, and calculatesone frame of depth image corresponding to the one frame of third image.The number of frames of the third image may be determined according to asecurity level of an application scene. Specifically, when theapplication scene requires a high security level, such as a paymentscene, more frames of third images should be calculated, in this case, apayment action will be executed only when multiple frames of depthimages are all successfully matched with a depth template of the user,so as to improve the security of payment; while for application scenesrequiring a low security level, such as an application scene forportrait beautification based on depth information, less frames of thirdimages are required, such as one frame of third image, in this case, oneframe of depth image is enough for performing the portraitbeautification. In this way, the calculation amount and powerconsumption of the processor 20 may be reduced, and the image processingspeed may be increased.

As illustrated in FIG. 1, FIG. 2 and FIG. 16, in some embodiments, thecontrolling method further includes:

0167, collecting visible light images at a third operating frequency,the third operating frequency being greater than or less than the secondoperating frequency;

0168, adding collection time for each frame of visible light image andeach frame of collection image; and

0169, determining frame-synchronized visible light image and secondimage according to the collection time of the visible light image, thecollection time of the collection image and the image type of thecollection image.

That is, the controlling method includes:

0161, determining an orientation of the laser projector 14;

0162, projecting a laser in a first mode by the laser projector 14 whenthe laser projector 14 is oriented toward the first side where thedisplay screen 12 is located;

0163, projecting a laser in a second mode by the laser projector 14 whenthe laser projector 14 is oriented toward the second side opposite tothe display screen 12, the energy of the laser projected in the secondmode is greater than that of the laser projected in the first mode;

0164, acquiring collection images by the image collector 15 at a secondoperating frequency when the laser projector 14 projects a laser to ascene at a first operating frequency, the second operating frequencybeing greater than the first operating frequency;

0165, distinguishing, among the collection images, a first imagecollected when the laser projector 14 does not project the laser from asecond image collected when the laser projector 14 projects the laser;

0166, calculating a depth image according to the first image, the secondimage and a reference image;

0167, collecting visible light images at a third operating frequency,the third operating frequency being greater than or less than the secondoperating frequency;

0168, adding collection time for each frame of visible light image andeach frame of collection image; and

0169, determining frame-synchronized visible light image and secondimage according to the collection time of the visible light image, thecollection time of the collection image and the image type of thecollection image.

The above controlling method may also be implemented by the electronicdevice 100, in which the step 0161 is basically the same as the step 041described hereinbefore, the step 0162 is basically the same as the step042 described hereinbefore, the step 0163 is basically the same as thestep 043 described hereinbefore, the step 0164 is basically the same asthe step 0114 described hereinbefore, the step 0165 is basically thesame as the step 0115 described hereinbefore, and the step 0166 isbasically the same as the step 0116 described hereinbefore. The step0167 may be implemented by the visible light camera 40 (any one of theprimary camera 41 and the secondary camera, or the primary camera 41 andthe secondary camera 42 together). The steps 0168 and 0169 may beimplemented by the processor 20. In other words, the visible lightcamera 40 may be configured to collect the visible light images at thethird operating frequency, and the third operating frequency is greaterthan or less than the second operating frequency. The processor 20 maybe configured to add the collection time for each frame of visible lightimage and each frame of collection image, and determine theframe-synchronized visible light image and second image according to thecollection time of the visible light image, the collection time of thecollection image and the image type of the collection image.

In some application scenes, for example, in an application scene for 3Dmodeling an object in the scene, the image collector 15 is used toobtain depth information of the object in the scene, and the visiblelight camera 40 is used to obtain color information of the object in thescene, so as to realize the 3D modeling. In this case, the processor 20needs to turn on the image collector 15 to obtain the depth image andsimultaneously turn on the visible light camera 40 to obtain the visiblelight image.

If the image collector 15 and the visible light camera 40 have the sameoperating frequency, that is, the image collector 15 and the visiblelight camera 40 both work at the second operating frequency, then theprocessor 20 may send an image collection instruction to the imagecollector 15 via the I2C bus, after receiving the image collectioninstruction, the image collector 15 is synchronized with the visiblelight camera 40 through a sync signal, which controls the visible lightcamera 40 to collect the visible light image, so as to realize hardwaresynchronization between the image collector 15 and the visible lightcamera 40. In this case, the number of frames of collection images isconsistent with the number of frames of visible light images, and thereis a one-to-one correspondence between the collection images and thevisible light images.

However, when the operating frequency of the image collector 15 isdifferent from that of the visible light camera 40, that is, the imagecollector 15 works at the second operating frequency, while the visiblelight camera 40 works at a third operating frequency that is not equalto the second operating frequency, the image collector 15 and thevisible light camera 40 cannot achieve the hardware synchronization. Inthis case, the processor 20 needs to achieve the synchronization betweenthe image collector 15 and the visible light camera 40 through softwaresynchronization. Specifically, the processor 20 sends an imagecollection instruction to the image collector 15 through an I2C busconnected to the image collector 15, and at the same time sends an imagecollection instruction to the visible light camera 40 through an I2C busconnected to the visible light camera 40. Each time the processor 20receives a frame of collection image, the processor 20 will add theimage type and the collection time for the collection image. Inaddition, each time the processor 20 receives a frame of visible lightimage, the processor 20 will add the collection time for the visiblelight image. The collection time of the collection image may be starttime or end time each time the image collector 15 collects thecollection image, or any time between the start time and the end time;and the collection time of the visible light image may be start time orend time each time the visible light camera 40 collects the visiblelight image, or any time between the start time and the end time. Then,in the subsequent processing (such as 3D modeling, and portraitbeautifying in virtue of the depth information, etc.) based on the depthimage and the visible light image, the processor 20 may first determinethe frame-synchronized visible light image and second image according tothe collection time of the visible light image, the collection time ofthe collection image and the type of the collection image. It should benoted that frame-synchronization indicates that the collection timedifference between the determined second image and visible light imageis less than the preset value, and the collection time of the visiblelight image may be either before or after the collection time of thesecond image. Subsequently, the processor 20 selects the first imageaccording to the determined second image to further calculate the depthimage according to the second image, the first image and the referenceimage. Finally, the processor 20 performs subsequent processing based onthe depth image and the determined visible light image.

In some embodiments, the processor 20 may also add collection time foreach frame of depth image, and then determine the frame-synchronizedvisible light image and depth image according to the collection time ofthe visible light image and the collection time of the depth image, andfinally perform subsequent processing on the frame-synchronized visiblelight image and depth image. The collection time of each frame of depthimage is the collection time of the second image corresponding to thisframe of depth image.

As illustrated in FIG. 17, in some embodiments, the collection imagealso includes an infrared image, and the infrared image is an imageformed by infrared light emitted by the floodlight 50 and collected byimage collector 15. When the processor 20 adds the image type for eachframe of collection image, the processor 20 also adds an image type forthe infrared image. In an example, the image type of the infrared imagesis shown in Table 3.

TABLE 3 stream_type stream light 0 1 0

In Table 3, when the stream is 0, it means that the data stream at thistime is an image formed by infrared light and/or infrared laser. Whenthe light is 10, it means that the data stream at this time is obtainedin the case that the floodlight 50 projects infrared light and the laserprojector 14 does not project a laser. Then, when the processor 20 addsthe stream_type 010 for a frame of collection image, it identifies thatthis frame of collection image is an infrared image.

In some application scenes, such as in identity verification based onboth the matching of the depth image with a depth template and thematching of the infrared image with an infrared template, the imagecollector 15 needs to be cooperated with the floodlight 50 and the laserprojector 14, and the image collector 15 obtains the first image, thesecond image and the infrared image in a time-sharing manner. Asillustrated in FIG. 17, a solid line represents laser emitting timing ofthe laser projector 14, a double-dot dash line represents infrared lightemitting timing of the floodlight 50, a dashed line represents timing ofthe image collector 15 for acquiring the collection images and thenumber of frames of the collection images, and a dot dash linerepresents the number of frames of the third images obtained accordingto the first image and the second image, and these four kinds of lines,i.e., the solid line, the double-dot dash line, the dashed line and thedot dash line are shown in this order from top to bottom in FIG. 17, thesecond operating frequency is three times the first operating frequency,and the second operating frequency is three times a fourth operatingfrequency. The processor 20 may monitor the operating state of thefloodlight 50 in real time via the I2C bus. Each time the processor 20receives a frame of collection image from the image collector 15, theprocessor 20 will first acquire the collection time of the collectionimage, and then determine according to the collection time of thecollection image whether the floodlight 50 emits infrared light or notduring the collection time of the collection image, and add the imagetype for the collection image based on the judgment result.Subsequently, the processor 20 may determine the infrared image and thesecond image whose collection time difference is less than the presetvalue based on the collection time of the infrared images and thecollection time of the second images. Further, the processor 20 maydetermine the infrared image and the depth image, and use the infraredimage and the depth image for identity verification.

As illustrated in FIG. 1, FIG. 2 and FIG. 18, in some embodiments, thecontrolling method further includes:

0181, acquiring a brightness and a type of a scene;

0182, determining whether the brightness of the scene is greater than abrightness threshold and the type of the scene is an outdoor scene; and

if the brightness of the scene is greater than the brightness thresholdand the type of the scene is the outdoor scene, entering a step ofdetermining an orientation of the laser projector 14 (step 0183).

That is, the controlling method includes:

0181, acquiring a brightness and a type of a scene;

0182, determining whether the brightness of the scene is greater than abrightness threshold and the type of the scene is an outdoor scene;

0183, if the brightness of the scene is greater than the brightnessthreshold and the type of the scene is the outdoor scene, determining anorientation of the laser projector 14;

0184, projecting a laser in a first mode by the laser projector 14 whenthe laser projector 14 is oriented toward the first side where thedisplay screen 12 is located;

0185, projecting a laser in a second mode by the laser projector 14 whenthe laser projector 14 is oriented toward the second side opposite tothe display screen 12, the energy of the laser projected in the secondmode is greater than that of the laser projected in the first mode;

0186, acquiring collection images by the image collector 15 at a secondoperating frequency when the laser projector 14 projects a laser to ascene at a first operating frequency, the second operating frequencybeing greater than the first operating frequency;

0187, distinguishing, among the collection images, a first imagecollected when the laser projector 14 does not project the laser from asecond image collected when the laser projector 14 projects the laser;and

0188, calculating a depth image according to the first image, the secondimage and a reference image.

The above controlling method may also be implemented by the electronicdevice 100, in which the step 0183 is basically the same as the step 041described hereinbefore, the step 0184 is basically the same as the step042 described hereinbefore, the step 0185 is basically the same as thestep 043 described hereinbefore, the step 0186 is basically the same asthe step 0114 described hereinbefore, the step 0187 is basically thesame as the step 0115 described hereinbefore, and the step 0188 isbasically the same as the step 0116 described hereinbefore. Both thesteps 0181 and 0182 may be implemented by the processor 20. That is, theprocessor 20 may be configured to acquire the brightness and the type ofthe scene, and determine whether the brightness of the scene is greaterthan the brightness threshold and the type of the scene is the outdoorscene. The laser projector 14 may be configured to project a laser tothe scene at the first operating frequency when the brightness of thescene is greater than the brightness threshold and the type of the sceneis the outdoor scene.

Specifically, the brightness of the scene may be obtained by analyzingthe collection image acquired by the image collector 15 or the visiblelight image acquired by the visible light camera 40 (any one of theprimary camera 41 and the secondary camera 42, or the primary camera 41and the secondary camera 42 together). Alternatively, the brightness ofthe scene may also be directly detected by a light sensor, and theprocessor 20 reads a detected signal from the light sensor to obtain thebrightness of the scene. The type of the scene may be obtained byanalyzing the collection image acquired by the image collector 15 or thevisible light image acquired by the visible light camera 40, forexample, analyzing the collection image or the object in the visiblelight image obtained by the visible light camera 40 to determine whetherthe type of the scene is an outdoor scene or an indoor scene; and thetype of the scene may also be determined directly according to ageographic location. Specifically, the processor 20 may acquire apositioning results of the scene by the global positioning system, andthen further determine the type of the scene according to thepositioning result, for example, if the positioning result shows acertain office building, it indicates that the scene is an indoor scene;if the positioning result shows a certain park, it indicates that thescene is an outdoor scene; if the positioning result shows a certainstreet, it indicates that the scene is an outdoor scene, and so on.

It will be understood that when the brightness of the scene is high (forexample, the brightness is greater than the brightness threshold), theproportion of the ambient infrared light in the collection image islarger, which has a greater impact on speckle recognition. In this case,the interference of the ambient infrared light needs to be removed.However, when the brightness of the scene is low, the proportion of theambient infrared light in the collection image is less, and the impacton the speckle recognition is small and may be ignored. In this case,the image collector 15 and the laser projector 14 can work at the sameoperating frequency, and the processor 20 calculates the depth imagedirectly according to the collection image (i.e., the second image)acquired by the image collector 15 and the reference image. In addition,the high brightness of the scene may be caused by strong light of anindoor lamp, since the light of the lamp does not include infraredlight, it will not generate a significant impact on the specklerecognition. In this case, the image collector 15 and the laserprojector 14 work at the same operating frequency, and the processor 20calculates the depth image directly according to the collection image(i.e., the second image) acquired by the image collector 15 and thereference image. In this way, the operating frequency and the powerconsumption of the image collector 15 are reduced.

Of course, in some embodiments, the controlling method may alsodetermine whether to perform the step 0183 based only on the brightnessof the scene. Specifically, the processor 20 only acquires thebrightness of the scene and determines whether the brightness of thescene is greater than the brightness threshold, and the laser projector14 projects a laser to the scene at the first operating frequency whenthe brightness is greater than the brightness threshold.

In some embodiments, the processor 20 may also add status information(status) for each data stream. In an example, as shown in Table 4:

TABLE 4 stream_type status stream light valid 0 0 0 0 0 0 1 0 0 1 0 0 01 1 1 1 X X 1 1 X X 0

When the status is 0, it means that the data stream does not undergobackground subtraction, and when the status is 1, it means that the datastream has undergone the background subtraction. In Table 4, 0000 meansthe first image; 0010 means the second image; 0100 means the infraredimage acquired by the image collector 15 when the floodlight 50 isturned on; 0111 means the third image; 1XX1 means the depth image afterthe background subtraction; 1XX0 means the depth image without thebackground subtraction. In this way, the status information is added foreach data stream, so that the processor 20 can distinguish whetherindividual data streams undergo the background subtraction.

In some embodiments, the processor 20 includes a first storage area, asecond storage area, and a logical subtraction circuit, and the logicalsubtraction circuit is connected to both the first storage area and thesecond storage area. The first storage area is configured to store thefirst image, the second storage area is configured to store the secondimage, and the logical subtraction circuit is configured to process thefirst image and the second image to obtain the third image.Specifically, the logical subtraction circuit reads the first image fromthe first storage area, reads the second image from the second storagearea, and performs subtraction processing on the first image and thesecond image to obtain the third image after acquiring the first imageand the second image. The logic subtraction circuit is also connected toa depth calculation module (for example, it may be an applicationspecific integrated circuit (ASIC) specifically used to calculate thedepth) in the processor 20, and the logic subtraction circuit sends thethird image to the depth calculation module, and the depth calculationmodule calculates the depth image according to the third image and thereference image.

Reference throughout this specification to “an embodiment,” “someembodiments,” “schematic embodiment,” “one example,” “an example,” “aspecific example,” or “some examples,” means that a particular feature,structure, material, or characteristic described in connection with theembodiment or example is included in at least one embodiment or exampleof the present disclosure. Thus, the appearances of these phrases invarious places throughout this specification are not necessarilyreferring to the same embodiment or example of the present disclosure.Furthermore, the described particular features, structures, materials,or characteristics may be combined in any suitable manner in one or moreembodiments or examples. In addition, in the absence of contradiction,different embodiments or examples described in this specification or thefeatures of different embodiments or examples may be combined by thoseskilled in the art.

Any process or method described in a flow chart or described herein inother ways may be understood to represent a module, segment, or portionof code that includes one or more executable instructions to implementspecified logic function(s) or that includes one or more executableinstructions of the steps in the process, and the scope of a preferredembodiment of the present disclosure includes other implementations, inwhich the order of execution is different from what is shown ordiscussed, including executing functions in a substantially simultaneousmanner or in an opposite order according to the related functions, whichshall be understood by those skilled in the art to which the embodimentsof the present disclosure belong.

Although embodiments have been shown and described above, it would beappreciated that the above embodiments are explanatory, which cannot beconstrued to limit the present disclosure, and changes, modifications,alternatives and variants can be made in the embodiments by thoseskilled in the art within the scope of the present disclosure.

What is claimed is:
 1. A controlling method for an electronic device,wherein the electronic device comprises a housing, a display screen anda rotatable assembly, the display screen is disposed at a side of thehousing, the rotatable assembly comprises a substrate and a laserprojector disposed in the substrate, the substrate is rotatablyinstalled to the housing such that the laser projector is selectivelyoriented toward a first side where the display screen is located ortoward a second side opposite to the display screen; and the controllingmethod comprises: determining an orientation of the laser projector;projecting a laser in a first mode by the laser projector when the laserprojector is oriented toward the first side where the display screen islocated; and projecting a laser in a second mode by the laser projectorwhen the laser projector is oriented toward the second side opposite tothe display screen, the laser projected in the second mode having agreater energy than that of the laser projected in the first mode. 2.The controlling method according to claim 1, wherein the electronicdevice further comprises a Hall sensor assembly, the Hall sensorassembly comprises a first sensor and a second sensor, the first sensoris disposed in the substrate, and the second sensor is disposed in thehousing and corresponds to the first sensor; wherein the determining theorientation of the laser projector comprises: determining theorientation of the laser projector through the Hall sensor assembly. 3.The controlling method according to claim 2, wherein the determining theorientation of the laser projector through the Hall sensor assemblycomprises: acquiring a Hall value of the Hall sensor assembly;determining that the laser projector is oriented toward the first sidewhere the display screen is located when the Hall value is less than afirst preset value; and determining that the laser projector is orientedtoward the second side opposite to the display screen when the Hallvalue is greater than a second preset value.
 4. The controlling methodaccording to claim 1, wherein the electronic device further comprises astate selection key, and the determining the orientation of the laserprojector comprises: determining the orientation of the laser projectorthrough the state selection key.
 5. The controlling method according toclaim 1, wherein a power of the laser projector for projecting the laserin the first mode is smaller than that of the laser projector forprojecting the laser in second mode; or the laser projector comprises aplurality of point light sources each controlled independently; and thenumber of the point light sources turned on by the laser projector inthe first mode is less than that of the point light sources turned on bythe laser projector in the second mode.
 6. The controlling methodaccording to claim 1, wherein the electronic device further comprises animage collector disposed at a surface of the substrate where the laserprojector is located; when the laser projector projects a laser, thelaser projector projects the laser at a first operating frequency to ascene; wherein the controlling method further comprises: acquiringcollection images by the image collector at a second operatingfrequency, the second operating frequency being greater than the firstoperating frequency; distinguishing, among the collection images, afirst image collected when the laser projector does not project thelaser from a second image collected when the laser projector projectsthe laser; and calculating a depth image according to the first image,the second image and a reference image.
 7. An electronic device,comprising: a housing, a display screen, disposed at a side of thehousing, a rotatable assembly, comprising a substrate and a laserprojector disposed in the substrate, the substrate being rotatablyinstalled to the housing such that the laser projector is selectivelyoriented toward a first side where the display screen is located ortoward a second side opposite to the display screen, and a processor,configured to determine an orientation of the laser projector; whereinthe laser projector is configured to: project a laser in a first modewhen the laser projector is oriented toward the first side where thedisplay screen is located; and project a laser in a second mode when thelaser projector is oriented toward the second side opposite to thedisplay screen, wherein the laser projected in the second mode has agreater energy than that of the laser projected in the first mode. 8.The electronic device according to claim 7, further comprising a Hallsensor assembly, wherein the Hall sensor assembly comprises a firstsensor and a second sensor, the first sensor is disposed in thesubstrate, and the second sensor is disposed in the housing andcorresponds to the first sensor; and the processor is further configuredto determine the orientation of the laser projector through the Hallsensor assembly.
 9. The electronic device according to claim 8, whereinthe processor is further configured to: acquire a Hall value of the Hallsensor assembly; determine that the laser projector is oriented towardthe first side where the display screen is located when the Hall valueis less than a first preset value; and determine that the laserprojector is oriented toward the second side opposite to the displayscreen when the Hall value is greater than a second preset value. 10.The electronic device according to claim 7, further comprising a stateselection key, wherein the processor is further configured to determinethe orientation of the laser projector through the state selection key.11. The electronic device according to claim 7, wherein a power of thelaser projector for projecting the laser in the first mode is smallerthan that of the laser projector for projecting the laser in secondmode; and/or the laser projector comprises a plurality of point lightsources each controlled independently; and the number of the point lightsources turned on by the laser projector in the first mode is less thanthat of the point light sources turned on by the laser projector in thesecond mode.
 12. The electronic device according to claim 7, furthercomprising an image collector disposed at a surface of the substratewhere the laser projector is located; wherein when the laser projectorprojects a laser, the laser projector is configured to project the laserat a first operating frequency to a scene; the image collector isconfigured to acquire collection images at a second operating frequency,and the second operating frequency is greater than the first operatingfrequency; and the processor is configured to: distinguish, among thecollection images, a first image collected when the laser projector doesnot project the laser from a second image collected when the laserprojector projects the laser; and calculate a depth image according tothe first image, the second image and a reference image.
 13. Theelectronic device according to claim 7, wherein the housing has an endsurface and a rear surface opposite to the display screen, the rearsurface is defined with a receiving groove penetrating the end surface,and the rotatable assembly is rotatably installed in the receivinggroove; when the laser projector is oriented toward the first side wherethe display screen is located, the substrate protrudes from the endsurface; when the laser projector is oriented toward the second sideopposite to the display screen, a surface of the substrate is flush withthe end surface of the housing.
 14. The electronic device according toclaim 7, wherein the housing has a front surface, a rear surface and anend surface, the front surface and the rear surface are located at twoopposite sides of the housing, respectively, the end surface isconnected with the front surface and the rear surface, the displayscreen is disposed on the front surface and defined with a notch at anend thereof close to the end surface, the housing is defined with anaccommodating groove which penetrates the front surface, the rearsurface and the end surface and is communicated with the notch, and therotatable assembly is rotatably installed in the accommodating groove.15. The electronic device according to claim 7, wherein the housing hasa front surface, a rear surface and an end surface, the display screenis disposed on the front surface of the housing and covers 85% or moreof an area of the front surface.
 16. The electronic device according toclaim 7, wherein the laser projector comprises a laser source, the lasersource comprises a plurality of point light sources; and the pluralityof the point light sources form a plurality of light emitting arraysarranged in an annular shape.
 17. The electronic device according toclaim 16, wherein the light emitting arrays are turned on in such amanner that the farther a light emitting array is away from a center ofthe laser source, the earlier the light emitting array is turned on. 18.The electronic device according to claim 7, wherein the laser projectorcomprises a laser source and a first driver, and the first driver isconfigured to drive the laser source to project a laser to an object tobe measured.
 19. The electronic device according to claim 7, wherein thehousing has a front surface, a rear surface and an end surface, thedisplay screen is disposed on the front surface of the housing anddefined with a notch at an end thereof close to the end surface.
 20. Theelectronic device according to claim 7, further comprising a floodlightdisposed at a surface of the substrate where the laser projector islocated.